how to remove all characters from a string in python

24

how to remove all characters from a string in python -

s = 'abc12321cba'

print(s.replace('a', ''))

drop all characters after a character in python -

sep = '...'
stripped = text.split(sep, 1)[0]

Comments

Submit
0 Comments